home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / biblio / bibtex / contrib / named.bst < prev    next >
Text File  |  1992-07-19  |  23KB  |  1,288 lines

  1. %NAME: named.bst
  2. % BibTeX `named' style file for BibTeX version 0.99c, LaTeX version 2.09
  3. % Place it in a file called named.bst in the BibTeX search path.  (Placing it
  4. % in the same directory as the LaTeX document should also work.)
  5. % Support for named citations is provided by named.sty
  6.  
  7. % This version was made by modifying the master file made by
  8. % Oren Patashnik (PATASHNIK@SCORE.STANFORD.EDU)
  9.  
  10. % Copyright (C) 1985, all rights reserved.
  11. % Modifications Copyright 1988, Peter F. Patel-Schneider
  12. % Copying of this file is authorized only if either
  13. % (1) you make absolutely no changes to your copy, including name, or
  14. % (2) if you do make changes, you name it something other than
  15. % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.
  16. % This restriction helps ensure that all standard styles are identical.
  17.  
  18. % There are undoubtably bugs in this style.  If you make bug fixes,
  19. % improvements, etc.  please let me know.  My e-mail address is:
  20. %    pfps@research.att.com
  21.  
  22. %   Citation format: [author-last-name, year]
  23. %             [author-last-name and author-last-name, year]
  24. %             [author-last-name {\em et al.}, year]
  25. %
  26. %   Reference list ordering: alphabetical by author or whatever passes
  27. %    for author in the absence of one.
  28. %
  29. % This BibTeX style has support for short (year only) citations.  This
  30. % is done by having the citations actually look like
  31. %         \citeauthoryear{author-info}{year}
  32. % The LaTeX style has to have the following (or similar)
  33. %     \let\@internalcite\cite
  34. %     \def\cite{\def\citeauthoryear##1##2{##1, ##2}\@internalcite}
  35. %     \def\shortcite{\def\citeauthoryear##1{##2}\@internalcite}
  36. %     \def\@biblabel#1{\def\citeauthoryear##1##2{##1, ##2}[#1]\hfill}
  37. % which makes \shortcite the macro for short citations.
  38.  
  39. ENTRY
  40.   { address
  41.     author
  42.     booktitle
  43.     chapter
  44.     edition
  45.     editor
  46.     howpublished
  47.     institution
  48.     journal
  49.     key
  50.     month
  51.     note
  52.     number
  53.     organization
  54.     pages
  55.     publisher
  56.     school
  57.     series
  58.     title
  59.     type
  60.     volume
  61.     year
  62.   }
  63.   {}
  64.   { label extra.label sort.label }
  65.  
  66. INTEGERS { output.state before.all mid.sentence after.sentence after.block }
  67.  
  68. FUNCTION {init.state.consts}
  69. { #0 'before.all :=
  70.   #1 'mid.sentence :=
  71.   #2 'after.sentence :=
  72.   #3 'after.block :=
  73. }
  74.  
  75. STRINGS { s t }
  76.  
  77. FUNCTION {output.nonnull}
  78. { 's :=
  79.   output.state mid.sentence =
  80.     { ", " * write$ }
  81.     { output.state after.block =
  82.     { add.period$ write$
  83.       newline$
  84.       "\newblock " write$
  85.     }
  86.     { output.state before.all =
  87.         'write$
  88.         { add.period$ " " * write$ }
  89.       if$
  90.     }
  91.       if$
  92.       mid.sentence 'output.state :=
  93.     }
  94.   if$
  95.   s
  96. }
  97.  
  98. FUNCTION {output}
  99. { duplicate$ empty$
  100.     'pop$
  101.     'output.nonnull
  102.   if$
  103. }
  104.  
  105. FUNCTION {output.check}
  106. { 't :=
  107.   duplicate$ empty$
  108.     { pop$ "empty " t * " in " * cite$ * warning$ }
  109.     'output.nonnull
  110.   if$
  111. }
  112.  
  113. FUNCTION {output.bibitem}
  114. { newline$
  115.  
  116.   "\bibitem[" write$
  117.   label write$
  118.   "]{" write$
  119.  
  120.   cite$ write$
  121.   "}" write$
  122.   newline$
  123.   ""
  124.   before.all 'output.state :=
  125. }
  126.  
  127. FUNCTION {fin.entry}
  128. { add.period$
  129.   write$
  130.   newline$
  131. }
  132.  
  133. FUNCTION {new.block}
  134. { output.state before.all =
  135.     'skip$
  136.     { after.block 'output.state := }
  137.   if$
  138. }
  139.  
  140. FUNCTION {new.sentence}
  141. { output.state after.block =
  142.     'skip$
  143.     { output.state before.all =
  144.     'skip$
  145.     { after.sentence 'output.state := }
  146.       if$
  147.     }
  148.   if$
  149. }
  150.  
  151. FUNCTION {not}
  152. {   { #0 }
  153.     { #1 }
  154.   if$
  155. }
  156.  
  157. FUNCTION {and}
  158. {   'skip$
  159.     { pop$ #0 }
  160.   if$
  161. }
  162.  
  163. FUNCTION {or}
  164. {   { pop$ #1 }
  165.     'skip$
  166.   if$
  167. }
  168.  
  169. FUNCTION {new.block.checka}
  170. { empty$
  171.     'skip$
  172.     'new.block
  173.   if$
  174. }
  175.  
  176. FUNCTION {new.block.checkb}
  177. { empty$
  178.   swap$ empty$
  179.   and
  180.     'skip$
  181.     'new.block
  182.   if$
  183. }
  184.  
  185. FUNCTION {new.sentence.checka}
  186. { empty$
  187.     'skip$
  188.     'new.sentence
  189.   if$
  190. }
  191.  
  192. FUNCTION {new.sentence.checkb}
  193. { empty$
  194.   swap$ empty$
  195.   and
  196.     'skip$
  197.     'new.sentence
  198.   if$
  199. }
  200.  
  201. FUNCTION {field.or.null}
  202. { duplicate$ empty$
  203.     { pop$ "" }
  204.     'skip$
  205.   if$
  206. }
  207.  
  208. FUNCTION {emphasize}
  209. { duplicate$ empty$
  210.     { pop$ "" }
  211.     { "{\em " swap$ * "}" * }
  212.   if$
  213. }
  214.  
  215. INTEGERS { nameptr namesleft numnames }
  216.  
  217. FUNCTION {format.names}
  218. { 's :=
  219.   #1 'nameptr :=
  220.   s num.names$ 'numnames :=
  221.   numnames 'namesleft :=
  222.     { namesleft #0 > }
  223.  
  224.     { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
  225.  
  226.       nameptr #1 >
  227.     { namesleft #1 >
  228.         { ", " * t * }
  229.         { numnames #2 >
  230.         { "," * }
  231.         'skip$
  232.           if$
  233.           t "others" =
  234.         { " et~al." * }
  235.         { " and " * t * }
  236.           if$
  237.         }
  238.       if$
  239.     }
  240.     't
  241.       if$
  242.       nameptr #1 + 'nameptr :=
  243.       namesleft #1 - 'namesleft :=
  244.     }
  245.   while$
  246. }
  247.  
  248. FUNCTION {format.authors}
  249. { author empty$
  250.     { "" }
  251.     { author format.names }
  252.   if$
  253. }
  254.  
  255. FUNCTION {format.editors}
  256. { editor empty$
  257.     { "" }
  258.     { editor format.names
  259.       editor num.names$ #1 >
  260.     { ", editors" * }
  261.     { ", editor" * }
  262.       if$
  263.     }
  264.   if$
  265. }
  266.  
  267. FUNCTION {format.title}
  268. { title empty$
  269.     { "" }
  270.  
  271.     { title "t" change.case$ }
  272.  
  273.   if$
  274. }
  275.  
  276. FUNCTION {n.dashify}
  277. { 't :=
  278.   ""
  279.     { t empty$ not }
  280.     { t #1 #1 substring$ "-" =
  281.     { t #1 #2 substring$ "--" = not
  282.         { "--" *
  283.           t #2 global.max$ substring$ 't :=
  284.         }
  285.         {   { t #1 #1 substring$ "-" = }
  286.         { "-" *
  287.           t #2 global.max$ substring$ 't :=
  288.         }
  289.           while$
  290.         }
  291.       if$
  292.     }
  293.     { t #1 #1 substring$ *
  294.       t #2 global.max$ substring$ 't :=
  295.     }
  296.       if$
  297.     }
  298.   while$
  299. }
  300.  
  301. FUNCTION {format.date}
  302. { year empty$
  303.     { month empty$
  304.     { "" }
  305.     { "there's a month but no year in " cite$ * warning$
  306.       month
  307.     }
  308.       if$
  309.     }
  310.     { month empty$
  311.     'year
  312.     { month " " * year * }
  313.       if$
  314.     }
  315.   if$
  316. }
  317.  
  318. FUNCTION {format.btitle}
  319. { title emphasize
  320. }
  321.  
  322. FUNCTION {tie.or.space.connect}
  323. { duplicate$ text.length$ #3 <
  324.     { "~" }
  325.     { " " }
  326.   if$
  327.   swap$ * *
  328. }
  329.  
  330. FUNCTION {either.or.check}
  331. { empty$
  332.     'pop$
  333.     { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  334.   if$
  335. }
  336.  
  337. FUNCTION {format.bvolume}
  338. { volume empty$
  339.     { "" }
  340.     { "volume" volume tie.or.space.connect
  341.       series empty$
  342.     'skip$
  343.     { " of " * series emphasize * }
  344.       if$
  345.       "volume and number" number either.or.check
  346.     }
  347.   if$
  348. }
  349.  
  350. FUNCTION {format.number.series}
  351. { volume empty$
  352.     { number empty$
  353.     { series field.or.null }
  354.     { output.state mid.sentence =
  355.         { "number" }
  356.         { "Number" }
  357.       if$
  358.       number tie.or.space.connect
  359.       series empty$
  360.         { "there's a number but no series in " cite$ * warning$ }
  361.         { " in " * series * }
  362.       if$
  363.     }
  364.       if$
  365.     }
  366.     { "" }
  367.   if$
  368. }
  369.  
  370. FUNCTION {format.edition}
  371. { edition empty$
  372.     { "" }
  373.     { output.state mid.sentence =
  374.     { edition "l" change.case$ " edition" * }
  375.     { edition "t" change.case$ " edition" * }
  376.       if$
  377.     }
  378.   if$
  379. }
  380.  
  381. INTEGERS { multiresult }
  382.  
  383. FUNCTION {multi.page.check}
  384. { 't :=
  385.   #0 'multiresult :=
  386.     { multiresult not
  387.       t empty$ not
  388.       and
  389.     }
  390.     { t #1 #1 substring$
  391.       duplicate$ "-" =
  392.       swap$ duplicate$ "," =
  393.       swap$ "+" =
  394.       or or
  395.     { #1 'multiresult := }
  396.     { t #2 global.max$ substring$ 't := }
  397.       if$
  398.     }
  399.   while$
  400.   multiresult
  401. }
  402.  
  403. FUNCTION {format.pages}
  404. { pages empty$
  405.     { "" }
  406.     { pages multi.page.check
  407.     { "pages" pages n.dashify tie.or.space.connect }
  408.     { "page" pages tie.or.space.connect }
  409.       if$
  410.     }
  411.   if$
  412. }
  413.  
  414. FUNCTION {format.vol.num.pages}
  415. { volume field.or.null
  416.   number empty$
  417.     'skip$
  418.     { "(" number * ")" * *
  419.       volume empty$
  420.     { "there's a number but no volume in " cite$ * warning$ }
  421.     'skip$
  422.       if$
  423.     }
  424.   if$
  425.   pages empty$
  426.     'skip$
  427.     { duplicate$ empty$
  428.     { pop$ format.pages }
  429.     { ":" * pages n.dashify * }
  430.       if$
  431.     }
  432.   if$
  433. }
  434.  
  435. FUNCTION {format.chapter.pages}
  436. { chapter empty$
  437.     'format.pages
  438.     { type empty$
  439.     { "chapter" }
  440.     { type "l" change.case$ }
  441.       if$
  442.       chapter tie.or.space.connect
  443.       pages empty$
  444.     'skip$
  445.     { ", " * format.pages * }
  446.       if$
  447.     }
  448.   if$
  449. }
  450.  
  451. FUNCTION {format.in.ed.booktitle}
  452. { booktitle empty$
  453.     { "" }
  454.     { editor empty$
  455.     { "In " booktitle emphasize * }
  456.     { "In " format.editors * ", " * booktitle emphasize * }
  457.       if$
  458.     }
  459.   if$
  460. }
  461.  
  462. FUNCTION {empty.misc.check}
  463. { author empty$ title empty$ howpublished empty$
  464.   month empty$ year empty$ note empty$
  465.   and and and and and
  466.  
  467.   key empty$ not and
  468.  
  469.     { "all relevant fields are empty in " cite$ * warning$ }
  470.     'skip$
  471.   if$
  472. }
  473.  
  474. FUNCTION {format.thesis.type}
  475. { type empty$
  476.     'skip$
  477.     { pop$
  478.       type "t" change.case$
  479.     }
  480.   if$
  481. }
  482.  
  483. FUNCTION {format.tr.number}
  484. { type empty$
  485.     { "Technical Report" }
  486.     'type
  487.   if$
  488.   number empty$
  489.     { "t" change.case$ }
  490.     { number tie.or.space.connect }
  491.   if$
  492. }
  493.  
  494. FUNCTION {format.article.crossref}
  495. { key empty$
  496.     { journal empty$
  497.     { "need key or journal for " cite$ * " to crossref " * crossref *
  498.       warning$
  499.       ""
  500.     }
  501.     { "In {\em " journal * "\/}" * }
  502.       if$
  503.     }
  504.     { "In " key * }
  505.   if$
  506.   " \shortcite{" * crossref * "}" *
  507. }
  508.  
  509. FUNCTION {format.crossref.editor}
  510. { editor #1 "{vv~}{ll}" format.name$
  511.   editor num.names$ duplicate$
  512.   #2 >
  513.     { pop$ " et~al." * }
  514.     { #2 <
  515.     'skip$
  516.     { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  517.         { " et~al." * }
  518.         { " and " * editor #2 "{vv~}{ll}" format.name$ * }
  519.       if$
  520.     }
  521.       if$
  522.     }
  523.   if$
  524. }
  525.  
  526. FUNCTION {format.book.crossref}
  527. { volume empty$
  528.     { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
  529.       "In "
  530.     }
  531.     { "Volume" volume tie.or.space.connect
  532.       " of " *
  533.     }
  534.   if$
  535.   editor empty$
  536.   editor field.or.null author field.or.null =
  537.   or
  538.     { key empty$
  539.     { series empty$
  540.         { "need editor, key, or series for " cite$ * " to crossref " *
  541.           crossref * warning$
  542.           "" *
  543.         }
  544.         { "{\em " * series * "\/}" * }
  545.       if$
  546.     }
  547.     { key * }
  548.       if$
  549.     }
  550.     { format.crossref.editor * }
  551.   if$
  552.   " \shortcite{" * crossref * "}" *
  553. }
  554.  
  555. FUNCTION {format.incoll.inproc.crossref}
  556. { editor empty$
  557.   editor field.or.null author field.or.null =
  558.   or
  559.     { key empty$
  560.     { booktitle empty$
  561.         { "need editor, key, or booktitle for " cite$ * " to crossref " *
  562.           crossref * warning$
  563.           ""
  564.         }
  565.         { "In {\em " booktitle * "\/}" * }
  566.       if$
  567.     }
  568.     { "In " key * }
  569.       if$
  570.     }
  571.     { "In " format.crossref.editor * }
  572.   if$
  573.   " \shortcite{" * crossref * "}" *
  574. }
  575.  
  576. FUNCTION {article}
  577. { output.bibitem
  578.   format.authors "author" output.check
  579.   new.block
  580.   format.title "title" output.check
  581.   new.block
  582.   crossref missing$
  583.     { journal emphasize "journal" output.check
  584.       format.vol.num.pages output
  585.       format.date "year" output.check
  586.     }
  587.     { format.article.crossref output.nonnull
  588.       format.pages output
  589.     }
  590.   if$
  591.   new.block
  592.   note output
  593.   fin.entry
  594. }
  595.  
  596. FUNCTION {book}
  597. { output.bibitem
  598.   author empty$
  599.     { format.editors "author and editor" output.check }
  600.     { format.authors output.nonnull
  601.       crossref missing$
  602.     { "author and editor" editor either.or.check }
  603.     'skip$
  604.       if$
  605.     }
  606.   if$
  607.   new.block
  608.   format.btitle "title" output.check
  609.   crossref missing$
  610.     { format.bvolume output
  611.       new.block
  612.       format.number.series output
  613.       new.sentence
  614.       publisher "publisher" output.check
  615.       address output
  616.     }
  617.     { new.block
  618.       format.book.crossref output.nonnull
  619.     }
  620.   if$
  621.   format.edition output
  622.   format.date "year" output.check
  623.   new.block
  624.   note output
  625.   fin.entry
  626. }
  627.  
  628. FUNCTION {booklet}
  629. { output.bibitem
  630.   format.authors output
  631.   new.block
  632.   format.title "title" output.check
  633.   howpublished address new.block.checkb
  634.   howpublished output
  635.   address output
  636.   format.date output
  637.   new.block
  638.   note output
  639.   fin.entry
  640. }
  641.  
  642. FUNCTION {inbook}
  643. { output.bibitem
  644.   author empty$
  645.     { format.editors "author and editor" output.check }
  646.     { format.authors output.nonnull
  647.       crossref missing$
  648.     { "author and editor" editor either.or.check }
  649.     'skip$
  650.       if$
  651.     }
  652.   if$
  653.   new.block
  654.   format.btitle "title" output.check
  655.   crossref missing$
  656.     { format.bvolume output
  657.       format.chapter.pages "chapter and pages" output.check
  658.       new.block
  659.       format.number.series output
  660.       new.sentence
  661.       publisher "publisher" output.check
  662.       address output
  663.     }
  664.     { format.chapter.pages "chapter and pages" output.check
  665.       new.block
  666.       format.book.crossref output.nonnull
  667.     }
  668.   if$
  669.   format.edition output
  670.   format.date "year" output.check
  671.   new.block
  672.   note output
  673.   fin.entry
  674. }
  675.  
  676. FUNCTION {incollection}
  677. { output.bibitem
  678.   format.authors "author" output.check
  679.   new.block
  680.   format.title "title" output.check
  681.   new.block
  682.   crossref missing$
  683.     { format.in.ed.booktitle "booktitle" output.check
  684.       format.bvolume output
  685.       format.number.series output
  686.       format.chapter.pages output
  687.       new.sentence
  688.       publisher "publisher" output.check
  689.       address output
  690.       format.edition output
  691.       format.date "year" output.check
  692.     }
  693.     { format.incoll.inproc.crossref output.nonnull
  694.       format.chapter.pages output
  695.     }
  696.   if$
  697.   new.block
  698.   note output
  699.   fin.entry
  700. }
  701.  
  702. FUNCTION {inproceedings}
  703. { output.bibitem
  704.   format.authors "author" output.check
  705.   new.block
  706.   format.title "title" output.check
  707.   new.block
  708.   crossref missing$
  709.     { format.in.ed.booktitle "booktitle" output.check
  710.       format.bvolume output
  711.       format.number.series output
  712.       format.pages output
  713.       address empty$
  714.     { organization publisher new.sentence.checkb
  715.       organization output
  716.       publisher output
  717.       format.date "year" output.check
  718.     }
  719.     { address output.nonnull
  720.       format.date "year" output.check
  721.       new.sentence
  722.       organization output
  723.       publisher output
  724.     }
  725.       if$
  726.     }
  727.     { format.incoll.inproc.crossref output.nonnull
  728.       format.pages output
  729.     }
  730.   if$
  731.   new.block
  732.   note output
  733.   fin.entry
  734. }
  735.  
  736. FUNCTION {conference} { inproceedings }
  737.  
  738. FUNCTION {manual}
  739. { output.bibitem
  740.   author empty$
  741.     { organization empty$
  742.     'skip$
  743.     { organization output.nonnull
  744.       address output
  745.     }
  746.       if$
  747.     }
  748.     { format.authors output.nonnull }
  749.   if$
  750.   new.block
  751.   format.btitle "title" output.check
  752.   author empty$
  753.     { organization empty$
  754.     { address new.block.checka
  755.       address output
  756.     }
  757.     'skip$
  758.       if$
  759.     }
  760.     { organization address new.block.checkb
  761.       organization output
  762.       address output
  763.     }
  764.   if$
  765.   format.edition output
  766.   format.date output
  767.   new.block
  768.   note output
  769.   fin.entry
  770. }
  771.  
  772. FUNCTION {mastersthesis}
  773. { output.bibitem
  774.   format.authors "author" output.check
  775.   new.block
  776.   format.title "title" output.check
  777.   new.block
  778.   "Master's thesis" format.thesis.type output.nonnull
  779.   school "school" output.check
  780.   address output
  781.   format.date "year" output.check
  782.   new.block
  783.   note output
  784.   fin.entry
  785. }
  786.  
  787. FUNCTION {misc}
  788. { output.bibitem
  789.   format.authors output
  790.   title howpublished new.block.checkb
  791.   format.title output
  792.   howpublished new.block.checka
  793.   howpublished output
  794.   format.date output
  795.   new.block
  796.   note output
  797.   fin.entry
  798.   empty.misc.check
  799. }
  800.  
  801. FUNCTION {phdthesis}
  802. { output.bibitem
  803.   format.authors "author" output.check
  804.   new.block
  805.   format.btitle "title" output.check
  806.   new.block
  807.   "PhD thesis" format.thesis.type output.nonnull
  808.   school "school" output.check
  809.   address output
  810.   format.date "year" output.check
  811.   new.block
  812.   note output
  813.   fin.entry
  814. }
  815.  
  816. FUNCTION {proceedings}
  817. { output.bibitem
  818.   editor empty$
  819.     { organization output }
  820.     { format.editors output.nonnull }
  821.   if$
  822.   new.block
  823.   format.btitle "title" output.check
  824.   format.bvolume output
  825.   format.number.series output
  826.   address empty$
  827.     { editor empty$
  828.     { publisher new.sentence.checka }
  829.     { organization publisher new.sentence.checkb
  830.       organization output
  831.     }
  832.       if$
  833.       publisher output
  834.       format.date "year" output.check
  835.     }
  836.     { address output.nonnull
  837.       format.date "year" output.check
  838.       new.sentence
  839.       editor empty$
  840.     'skip$
  841.     { organization output }
  842.       if$
  843.       publisher output
  844.     }
  845.   if$
  846.   new.block
  847.   note output
  848.   fin.entry
  849. }
  850.  
  851. FUNCTION {techreport}
  852. { output.bibitem
  853.   format.authors "author" output.check
  854.   new.block
  855.   format.title "title" output.check
  856.   new.block
  857.   format.tr.number output.nonnull
  858.   institution "institution" output.check
  859.   address output
  860.   format.date "year" output.check
  861.   new.block
  862.   note output
  863.   fin.entry
  864. }
  865.  
  866. FUNCTION {unpublished}
  867. { output.bibitem
  868.   format.authors "author" output.check
  869.   new.block
  870.   format.title "title" output.check
  871.   new.block
  872.   note "note" output.check
  873.   format.date output
  874.   fin.entry
  875. }
  876.  
  877. FUNCTION {default.type} { misc }
  878.  
  879. MACRO {jan} {"January"}
  880.  
  881. MACRO {feb} {"February"}
  882.  
  883. MACRO {mar} {"March"}
  884.  
  885. MACRO {apr} {"April"}
  886.  
  887. MACRO {may} {"May"}
  888.  
  889. MACRO {jun} {"June"}
  890.  
  891. MACRO {jul} {"July"}
  892.  
  893. MACRO {aug} {"August"}
  894.  
  895. MACRO {sep} {"September"}
  896.  
  897. MACRO {oct} {"October"}
  898.  
  899. MACRO {nov} {"November"}
  900.  
  901. MACRO {dec} {"December"}
  902.  
  903. MACRO {acmcs} {"ACM Computing Surveys"}
  904.  
  905. MACRO {acta} {"Acta Informatica"}
  906.  
  907. MACRO {cacm} {"Communications of the ACM"}
  908.  
  909. MACRO {ibmjrd} {"IBM Journal of Research and Development"}
  910.  
  911. MACRO {ibmsj} {"IBM Systems Journal"}
  912.  
  913. MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
  914.  
  915. MACRO {ieeetc} {"IEEE Transactions on Computers"}
  916.  
  917. MACRO {ieeetcad}
  918.  {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
  919.  
  920. MACRO {ipl} {"Information Processing Letters"}
  921.  
  922. MACRO {jacm} {"Journal of the ACM"}
  923.  
  924. MACRO {jcss} {"Journal of Computer and System Sciences"}
  925.  
  926. MACRO {scp} {"Science of Computer Programming"}
  927.  
  928. MACRO {sicomp} {"SIAM Journal on Computing"}
  929.  
  930. MACRO {tocs} {"ACM Transactions on Computer Systems"}
  931.  
  932. MACRO {tods} {"ACM Transactions on Database Systems"}
  933.  
  934. MACRO {tog} {"ACM Transactions on Graphics"}
  935.  
  936. MACRO {toms} {"ACM Transactions on Mathematical Software"}
  937.  
  938. MACRO {toois} {"ACM Transactions on Office Information Systems"}
  939.  
  940. MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
  941.  
  942. MACRO {tcs} {"Theoretical Computer Science"}
  943.  
  944. READ
  945.  
  946. FUNCTION {sortify}
  947. { purify$
  948.   "l" change.case$
  949. }
  950.  
  951. INTEGERS { len }
  952.  
  953. FUNCTION {chop.word}
  954. { 's :=
  955.   'len :=
  956.   s #1 len substring$ =
  957.     { s len #1 + global.max$ substring$ }
  958.     's
  959.   if$
  960. }
  961.  
  962. INTEGERS { et.al.char.used }
  963.  
  964. FUNCTION {initialize.et.al.char.used}
  965. { #0 'et.al.char.used :=
  966. }
  967.  
  968. EXECUTE {initialize.et.al.char.used}
  969.  
  970. FUNCTION {format.lab.names}
  971. { 's :=
  972.   s num.names$ 'numnames :=
  973.  
  974.   numnames #1 =
  975.     { s #1 "{vv }{ll}" format.name$ }
  976.     { numnames #2 =
  977.         { s #1 "{vv }{ll }and " format.name$ s #2 "{vv }{ll}" format.name$ *
  978.         }
  979.         { s #1 "{vv }{ll }\bgroup \em et al.\egroup " format.name$ }
  980.       if$
  981.     }
  982.   if$
  983.  
  984. }
  985.  
  986. FUNCTION {author.key.label}
  987. { author empty$
  988.     { key empty$
  989.  
  990.     { cite$ #1 #3 substring$ }
  991.  
  992.     { key }
  993.       if$
  994.     }
  995.     { author format.lab.names }
  996.   if$
  997. }
  998.  
  999. FUNCTION {author.editor.key.label}
  1000. { author empty$
  1001.     { editor empty$
  1002.     { key empty$
  1003.  
  1004.         { cite$ #1 #3 substring$ }
  1005.  
  1006.         { key }
  1007.       if$
  1008.     }
  1009.     { editor format.lab.names }
  1010.       if$
  1011.     }
  1012.     { author format.lab.names }
  1013.   if$
  1014. }
  1015.  
  1016. FUNCTION {author.key.organization.label}
  1017. { author empty$
  1018.     { key empty$
  1019.     { organization empty$
  1020.  
  1021.         { cite$ #1 #3 substring$ }
  1022.  
  1023.         { "The " #4 organization chop.word #3 text.prefix$ }
  1024.       if$
  1025.     }
  1026.     { key }
  1027.       if$
  1028.     }
  1029.     { author format.lab.names }
  1030.   if$
  1031. }
  1032.  
  1033. FUNCTION {editor.key.organization.label}
  1034. { editor empty$
  1035.     { key empty$
  1036.     { organization empty$
  1037.  
  1038.         { cite$ #1 #3 substring$ }
  1039.  
  1040.         { "The " #4 organization chop.word #3 text.prefix$ }
  1041.       if$
  1042.     }
  1043.     { key }
  1044.       if$
  1045.     }
  1046.     { editor format.lab.names }
  1047.   if$
  1048. }
  1049.  
  1050. FUNCTION {calc.label}
  1051. { type$ "book" =
  1052.   type$ "inbook" =
  1053.   or
  1054.     'author.editor.key.label
  1055.     { type$ "proceedings" =
  1056.     'editor.key.organization.label
  1057.     { type$ "manual" =
  1058.         'author.key.organization.label
  1059.         'author.key.label
  1060.       if$
  1061.     }
  1062.       if$
  1063.     }
  1064.   if$
  1065.   duplicate$
  1066.  
  1067.   "\protect\citeauthoryear{" swap$ * "}{" *
  1068.   year field.or.null purify$ *  % CHANGED - pfps - 15 Feb 1989
  1069.   'label :=
  1070.   year field.or.null purify$ *
  1071.  
  1072.   sortify 'sort.label :=
  1073. }
  1074.  
  1075. FUNCTION {sort.format.names}
  1076. { 's :=
  1077.   #1 'nameptr :=
  1078.   ""
  1079.   s num.names$ 'numnames :=
  1080.   numnames 'namesleft :=
  1081.     { namesleft #0 > }
  1082.     { nameptr #1 >
  1083.     { "   " * }
  1084.     'skip$
  1085.       if$
  1086.  
  1087.       s nameptr "{vv{ } }{ll{ }}{  ff{ }}{  jj{ }}" format.name$ 't :=
  1088.  
  1089.       nameptr numnames = t "others" = and
  1090.     { "et al" * }
  1091.     { t sortify * }
  1092.       if$
  1093.       nameptr #1 + 'nameptr :=
  1094.       namesleft #1 - 'namesleft :=
  1095.     }
  1096.   while$
  1097. }
  1098.  
  1099. FUNCTION {sort.format.title}
  1100. { 't :=
  1101.   "A " #2
  1102.     "An " #3
  1103.       "The " #4 t chop.word
  1104.     chop.word
  1105.   chop.word
  1106.   sortify
  1107.   #1 global.max$ substring$
  1108. }
  1109.  
  1110. FUNCTION {author.sort}
  1111. { author empty$
  1112.     { key empty$
  1113.     { "to sort, need author or key in " cite$ * warning$
  1114.       ""
  1115.     }
  1116.     { key sortify }
  1117.       if$
  1118.     }
  1119.     { author sort.format.names }
  1120.   if$
  1121. }
  1122.  
  1123. FUNCTION {author.editor.sort}
  1124. { author empty$
  1125.     { editor empty$
  1126.     { key empty$
  1127.         { "to sort, need author, editor, or key in " cite$ * warning$
  1128.           ""
  1129.         }
  1130.         { key sortify }
  1131.       if$
  1132.     }
  1133.     { editor sort.format.names }
  1134.       if$
  1135.     }
  1136.     { author sort.format.names }
  1137.   if$
  1138. }
  1139.  
  1140. FUNCTION {author.organization.sort}
  1141. { author empty$
  1142.     { organization empty$
  1143.     { key empty$
  1144.         { "to sort, need author, organization, or key in " cite$ * warning$
  1145.           ""
  1146.         }
  1147.         { key sortify }
  1148.       if$
  1149.     }
  1150.     { "The " #4 organization chop.word sortify }
  1151.       if$
  1152.     }
  1153.     { author sort.format.names }
  1154.   if$
  1155. }
  1156.  
  1157. FUNCTION {editor.organization.sort}
  1158. { editor empty$
  1159.     { organization empty$
  1160.     { key empty$
  1161.         { "to sort, need editor, organization, or key in " cite$ * warning$
  1162.           ""
  1163.         }
  1164.         { key sortify }
  1165.       if$
  1166.     }
  1167.     { "The " #4 organization chop.word sortify }
  1168.       if$
  1169.     }
  1170.     { editor sort.format.names }
  1171.   if$
  1172. }
  1173.  
  1174. FUNCTION {presort}
  1175.  
  1176. { calc.label
  1177.   sort.label
  1178.   "    "
  1179.   *
  1180.   type$ "book" =
  1181.  
  1182.   type$ "inbook" =
  1183.   or
  1184.     'author.editor.sort
  1185.     { type$ "proceedings" =
  1186.     'editor.organization.sort
  1187.     { type$ "manual" =
  1188.         'author.organization.sort
  1189.         'author.sort
  1190.       if$
  1191.     }
  1192.       if$
  1193.     }
  1194.   if$
  1195.  
  1196.   *
  1197.  
  1198.   "    "
  1199.   *
  1200.   year field.or.null sortify
  1201.   *
  1202.   "    "
  1203.   *
  1204.   title field.or.null
  1205.   sort.format.title
  1206.   *
  1207.   #1 entry.max$ substring$
  1208.   'sort.key$ :=
  1209. }
  1210.  
  1211. ITERATE {presort}
  1212.  
  1213. SORT
  1214.  
  1215. STRINGS { longest.label last.sort.label next.extra }
  1216.  
  1217. INTEGERS { longest.label.width last.extra.num }
  1218.  
  1219. FUNCTION {initialize.longest.label}
  1220. { "" 'longest.label :=
  1221.   #0 int.to.chr$ 'last.sort.label :=
  1222.   "" 'next.extra :=
  1223.   #0 'longest.label.width :=
  1224.   #0 'last.extra.num :=
  1225. }
  1226.  
  1227. FUNCTION {forward.pass}
  1228. { last.sort.label sort.label =
  1229.     { last.extra.num #1 + 'last.extra.num :=
  1230.       last.extra.num int.to.chr$ 'extra.label :=
  1231.     }
  1232.     { "a" chr.to.int$ 'last.extra.num :=
  1233.       "" 'extra.label :=
  1234.       sort.label 'last.sort.label :=
  1235.     }
  1236.   if$
  1237. }
  1238.  
  1239. FUNCTION {reverse.pass}
  1240. { next.extra "b" =
  1241.     { "a" 'extra.label := }
  1242.     'skip$
  1243.   if$
  1244.   label extra.label * "}" * 'label :=   % CHANGED - pfps 15 Feb 1989
  1245.   label width$ longest.label.width >
  1246.     { label 'longest.label :=
  1247.       label width$ 'longest.label.width :=
  1248.     }
  1249.     'skip$
  1250.   if$
  1251.   extra.label 'next.extra :=
  1252. }
  1253.  
  1254. EXECUTE {initialize.longest.label}
  1255.  
  1256. ITERATE {forward.pass}
  1257.  
  1258. REVERSE {reverse.pass}
  1259.  
  1260. FUNCTION {begin.bib}
  1261.  
  1262. { et.al.char.used
  1263.     { "\newcommand{\etalchar}[1]{$^{#1}$}" write$ newline$ }
  1264.     'skip$
  1265.   if$
  1266.   preamble$ empty$
  1267.  
  1268.     'skip$
  1269.     { preamble$ write$ newline$ }
  1270.   if$
  1271.  
  1272.   "\begin{thebibliography}{}" write$ newline$
  1273.  
  1274. }
  1275.  
  1276. EXECUTE {begin.bib}
  1277.  
  1278. EXECUTE {init.state.consts}
  1279.  
  1280. ITERATE {call.type$}
  1281.  
  1282. FUNCTION {end.bib}
  1283. { newline$
  1284.   "\end{thebibliography}" write$ newline$
  1285. }
  1286.  
  1287. EXECUTE {end.bib}
  1288.